<?php
     @header("Content-Type:text/html;charset=utf-8");    // 配置php文件返回的 文本类型 编码(适应低版本)

// 选择结构

    // if
        $grade = rand(0,100);       // rand() 随机生成一个数

        echo $grade;

        if($grade >= 90) {
            echo "完美"."<br>";
        } else if ($grade >= 80) {
            echo "优秀"."<br>";
        } else if ($grade >= 70) {
            echo "良好"."<br>";
        } else if ($grade >= 60) {
            echo "及格"."<br>";
        } else {
            echo "不及格"."<br>";
        }

    // switch
        $day =  rand(1,7); 

        echo $day;

        switch($day) {
            case 1:
                echo "面条";
                break;
            case 2:
                echo "面包";
                break;
            case 3:
                echo "糯米鸡";
                break;
            case 4:
                echo "小笼包";
                break;
            case 5:
                echo "饺子";
                break;
            case 6:
                echo "热干面";
                break;
            default:
                echo "粥";
        }
        
?>